home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #6 / Amiga Plus CD - 2004 - No. 06.iso / AmigaPlus / Begleitmaterial / 50Tools / Grafik / PerfectPaint / KATalysator / KATalysator.rx
Text File  |  2002-09-28  |  32KB  |  1,456 lines

  1. /*
  2. KATalysator © by Saint & Antibike
  3. ==========================
  4.  
  5.  
  6. $VER: KATalysator 1.0pre (01.10.02)
  7. */
  8.  
  9.  /*Prepare the Work*/
  10. /******************/
  11.  
  12. addlib("rexxsupport.library",0,-30,0)
  13. Options results
  14. parse ARG Port b
  15. ADDRESS value Port
  16. call init()
  17. call loadprefs()
  18. call opengui()
  19. call SavePrefs("KATalysator",dir,sdir,thsf,thqual,thmax,thxsize,thysize,vbsf,vbqual,vbmax,xsize,ysize,rotate,thali,thflipx,thsmooth,thflipy,vbali,vbflipx,vbsmooth,vbflipy,brush,BrushF,ppz,ThImgB,tborder,htmid,vbimgb,httop,htbot,rekursiv,thactive,vbactive,ZpS,ThCo,VbCo,muster)
  20.  
  21. checkHtmlFiles()
  22.  
  23.  /*Sorted List for OS3.5+ List*/
  24. /*****************************/
  25.  
  26. ADDRESS COMMAND "Version C:List >t:VLs"
  27. open(V,"t:VLs",r)
  28. Version=readln(V)
  29. close(c)
  30. if substr(Version,6,2)>41 then DO
  31.     sort=" Sort=N "
  32.     END
  33.     ELSE DO
  34.     Sort=" "
  35.     END
  36.  
  37. say "source =" sdir
  38. say "dest = " dir
  39.  
  40.  /*List and count Pics*/
  41. /*********************/
  42.  
  43. if rekursiv=1 THEN DO
  44.     ADDRESS COMMAND 'C:List "' || sdir || Muster || '" all files LFORMAT=%F%N ' || Sort || ' >t:Liste' 
  45.     END
  46.     ELSE DO
  47.     ADDRESS COMMAND 'C:List "' || sdir || Muster || '" files LFORMAT=%F%N ' || Sort || ' >t:Liste' 
  48.     END
  49. bilder=countlines("T:Liste")
  50. if bilder=0 then do
  51.     pp_permitrefresh
  52.     exit
  53.     END
  54. open(names,"T:Liste",r)
  55.  
  56.  /*Percent?*/
  57. /**********/
  58. if pos("%",thxsize)~=0 then do
  59.     thxsize=seekrep(thxsize,"%"," ")
  60.     thxsize=compress(thxsize)
  61.     thxperc=1
  62.     END
  63. if pos("%",thysize)~=0 then do
  64.     thysize=seekrep(thysize,"%"," ")
  65.     thysize=compress(thysize)
  66.     thyperc=1
  67.     END
  68. if pos("%",xsize)~=0 then do
  69.     xsize=seekrep(xsize,"%"," ")
  70.     xsize=compress(xsize)
  71.     percx=1
  72.     END
  73. if pos("%",ysize)~=0 then do
  74.     ysize=seekrep(ysize,"%"," ")
  75.     ysize=compress(ysize)
  76.     percy=1
  77.     END
  78. if Brush~=1 then DO
  79.     IBrush=BrushInit(BrushF)
  80.     END
  81. stellen=length(bilder)
  82. getcurrentbuffer
  83. alterpuffer=result
  84. i=1 /*Nur richtige Bilder*/
  85. counter=1 /*Alle Files*/
  86.  
  87.  /*Allready an Index there?*/
  88. /**************************/
  89. if exists(dir || "index.html") THEN DO
  90.     pp_Multirequest "KATalysator*©*by*Saint&Antibike" "index.html*allready*exists!" "Overwrite|Quit"
  91.     choice=result
  92.     if choice=0 then do
  93.         EXIT
  94.         END
  95.     END
  96.  
  97.  /*Open the Index*/
  98. /****************/
  99.  
  100. indexinit(ppz,tborder,thimgb,thxsize,thysize,xsize,ysize,name,dir,0,httop,"Write",stellen)
  101.  
  102.  /*Let`s rock!*/
  103. /*************/
  104.  
  105. Do while ~eof(names)
  106.     i=right(i,stellen,"0")
  107.     name=seekrep(readln(names),"Ram Disk:","Ram:")
  108. setclip("counter",counter)
  109. setclip("bilder",bilder)
  110. prog(" ")
  111.     tmp=PreProgress(buffer,name,rotate)
  112.     say "tmp=" tmp
  113.     if tmp~=0 Then DO /*Nur wenn Bild geladen ist weitermachen*/
  114.         Parse Var tmp,h";"w";"d
  115.        
  116. ret=ProgressTh(ThFlipX,ThFlipY,W,H,D,ThMax,ThXperc,ThYperc,ThXSize,ThYSize,ThSf,dir,ppz,TBorder,ThImgB,Name,I,Stellen,ThAli,XSize,YSize,Buffer,thsmooth,thqual,Percx,Percy,VBMax,thActive,ThCo)
  117.         Call ProgressVb(PercX,PercY,XSize,YSize,VBMax,W,H,D,Brush,IBrush,VBSmooth,Dir,I,VBQual,VBSf,PPZ,TBorder,VBImgB,Name,HtMid,Stellen,VBAli,Buffer,Vbflipx,vbflipy,bilder,counter,vbActive,VbCo)
  118.         i=right(i+ret,stellen,0)
  119.         counter=counter+1
  120.     END
  121. END
  122.  
  123.  /*Clean up*/
  124. /**********/
  125.  
  126. indexinit(ppz,tborder,thimgb,thxsize,thysize,xsize,ysize,name,dir,i,htbot,"APPEND",stellen)
  127. pp_clearbuffer buffer
  128. pp_setbuffer alterpuffer
  129. pp_Progresstext ""
  130. pp_clearprogress
  131.  exit
  132. /****/
  133.  
  134.  
  135. ThsizeInit: 
  136.  
  137.  /*Calculate Thumbnail Size*/
  138. /**************************/
  139.  
  140. if thxPerc=1 then thXSize=(w*thxSize/100)
  141. if thyPerc=1 then thySize=(h*thySize/100)
  142.  
  143. if thMax=1 then DO
  144.     num1=w/thxsize
  145.     num2=h/thysize
  146.     if w>thxsize | h>thysize then do
  147.         if num1>num2 then thysize=h/num1
  148.         if num1<num2 then thxsize=w/num2
  149.         END
  150.     ELSE DO /*Bilder NICHT Hochskalieren!*/
  151.         thxsize=w
  152.         thysize=h
  153.         END
  154.     END
  155. thxsize=trunc(thxsize,0)
  156. thysize=trunc(thysize,0)
  157. return 0
  158.  
  159. VbSizeInit: 
  160.  
  161.  /*Calculate Image Size*/
  162. /**********************/
  163.  
  164. if Percx=1 then XSize=(w*xSize/100)
  165. if Percy=1 then ySize=(h*ySize/100)
  166.  
  167. if VbMax=1 then DO
  168.     num1=w/xsize
  169.     num2=h/ysize
  170.     if w>xsize | h>ysize then do
  171.         if num1>num2 then ysize=h/num1
  172.         if num1<num2 then xsize=w/num2
  173.         END
  174.     ELSE DO /*Do NOT UpScale!*/
  175.         xsize=w
  176.         ysize=h
  177.         END
  178.     END
  179. xsize=trunc(xsize,0)
  180. ysize=trunc(ysize,0) /*Trunc for the HTML Size*/
  181. return 0
  182.  
  183. PreProgress: Procedure
  184.  
  185.  /*ForEach...*/
  186. /************/
  187. buffer=arg(1)
  188. name=arg(2)
  189. rotate=arg(3)
  190.  
  191. pp_setbuffer Buffer          /*Set to empty Buffer*/
  192. prog("Loading...")
  193.  
  194. if name="" then Return 0     /*Couldn`t load Picture*/
  195. else do
  196.     result=ppload(name)
  197.     PARSE VAR result,h";"w";"d
  198. end
  199.  
  200. say "Breite=" w
  201.  
  202. if w="0" then Return 0 /*Couldn`t load Picture*/
  203.  
  204. DO while rotate~=0
  205.     prog("Rotating...")
  206.     pp_rot90    
  207.     rotate=rotate-1
  208.     tmp=w
  209.     w=h
  210.     h=tmp
  211.     END
  212. say "progress:"
  213. say "w;h;d;=" w";"h";"d
  214. return h";"w";"d
  215.  
  216.  
  217. ProgressTh: Procedure
  218.  
  219.  /*Processing Thumbnail*/
  220. /**********************/
  221.  
  222. ThFlipX=Arg(1)
  223. ThFlipY=Arg(2)
  224. W      =Arg(3)
  225. H      =Arg(4)
  226. D      =Arg(5)
  227. ThMax  =Arg(6)
  228. ThXperc=Arg(7)
  229. ThYperc=Arg(8)
  230. ThXSize=Arg(9)
  231. ThYSize=Arg(10)
  232. ThSf   =Arg(11)
  233. dir    =Arg(12)
  234. PPZ    =Arg(13)
  235. TBorder=Arg(14)
  236. ThImgB =Arg(15)
  237. Name   =Arg(16)
  238. I      =Arg(17)
  239. Stellen=Arg(18)
  240. ThAli  =Arg(19)
  241. XSize  =Arg(20)
  242. YSize  =Arg(21)
  243. Buffer =Arg(22)
  244. thsmooth=arg(23)
  245. thQual  =Arg(24)
  246. PercX   =Arg(25)
  247. PercY   =Arg(26)
  248. VBMax   =Arg(27)
  249. thActive=Arg(28)
  250. ThCo    =Arg(29)
  251.  
  252. say "Thumb bit = " ThCo
  253.  
  254. call ThsizeInit() /*Calculate the Size (no Procedures)*/
  255. call VbSizeInit()
  256.  
  257. if thActive=1 then DO /*Größe wird trotzdem für den Index benötigt*/
  258.  
  259.  
  260. if Thali=1 then pp_AliasOn
  261. ELSE  pp_AliasOff
  262.  
  263. pp_FindEmptyBuffer
  264. thBuffer=result
  265.     if thBuffer=-1 then DO
  266.         pp_Warn "can't*find*empty|Buffer."
  267.         EXIT        
  268.     END
  269. if d~=24 then DO
  270.     pp_convert2rgb
  271.     d=24
  272.     END
  273.  
  274. say "w = " w
  275. say "thxsize=" thxsize
  276.  
  277. say "Größen: " thxsize thysize
  278. if w~=thxsize | h~=thysize then DO
  279.     prog("Scaling...")
  280.     scale(Buffer,thBuffer,w,h,d,thxsize,thysize)
  281.     END
  282. if ThFlipx=1 then DO
  283.     prog("Flip*x...")
  284.     pp_FlipX
  285.     ENd
  286. if ThFlipy=1 then DO
  287.     prog("Flip*y...")
  288.     pp_Flipy
  289.     END
  290.  
  291. if thsmooth=1 then DO
  292.     prog("Smoothing...")
  293.     smooth(thxsize,thysize)
  294.     END
  295.     prog("Saving...")
  296.  
  297. If ThCo ~=9 then do /*Dithering*/
  298. dither(ThCo,thXsize,thYsize)
  299. END
  300.  
  301. ThSf=save(dir,"th" || i,thqual,ThSf,name)
  302. pp_clearbuffer thbuffer
  303. pp_setbuffer Buffer
  304. END /*if ThActive=1*/
  305. prog("Indexing...")
  306. format.0=".jpg"
  307. format.1=".png"
  308. format.2=".gif"
  309. format.3=".iff"
  310.  
  311. indexmake(ppz,tborder,ThImgB,thxsize,thysize,xsize,ysize,name,dir,i,stellen,format.ThSf,thActive)
  312.  
  313. return 1 /*Succeded*/
  314.  
  315. ProgressVb: Procedure
  316.  
  317.  /*Processing Fullsize Images*/
  318. /****************************/
  319.  
  320. PercX  =Arg(1)
  321. PercY  =Arg(2)
  322. XSize  =Arg(3)
  323. YSize  =Arg(4)
  324. VBMax  =Arg(5)
  325. W      =Arg(6)
  326. H      =Arg(7)
  327. D      =Arg(8)
  328. Brush  =Arg(9)
  329. IBrush =Arg(10)
  330. VBSmooth =Arg(11)
  331. Dir    =Arg(12)
  332. I      =Arg(13)
  333. VBQual =Arg(14)
  334. VBSf   =Arg(15)
  335. PPZ    =Arg(16)
  336. TBorder=Arg(17)
  337. VBImgB =Arg(18)
  338. Name   =Arg(19)
  339. HtMid  =Arg(20)
  340. Stellen=Arg(21)
  341. VbAli  =Arg(22)
  342. Buffer =Arg(23)
  343. VbFlipX=Arg(24)
  344. VbFlipY=Arg(25)
  345. gesamt =Arg(26)
  346. counter=Arg(27)
  347. vbActive=Arg(28)
  348. VbCo    =Arg(29)
  349.  
  350. call VbsizeInit()
  351. /*Call ThSizeInit() /*Still important for HTML Sizes*/*/
  352.  
  353. if VbActive=1 then DO
  354.  
  355. if VbAli=1 then pp_AliasOn
  356. ELSE  pp_AliasOff
  357.  
  358. if w~=xsize | h~=ysize then DO
  359.     prog("Scaling...")
  360.     pp_ScalePicture xsize ysize
  361.     END
  362. if VbFlipx=1 then DO
  363.     prog("Flip*x...")
  364.     pp_FlipX
  365.     ENd
  366. if VbFlipy=1 then DO
  367.     prog("Flip*y...")
  368.     pp_Flipy
  369.     END
  370.  
  371. say "Brush="Brush
  372. if Brush~=1 then do
  373.     prog("Brush...")
  374.     Brushplot(IBrush,brush,xsize,ysize) /*IBrush *g*/
  375.     END
  376. say "smooth=" vbsmooth
  377. if vbsmooth=1 then DO
  378.     prog("Smoothing")
  379.     smooth(xsize,ysize)
  380.     END
  381. prog("Saving...")
  382. If VbCo ~=9 then do /*Dithering*/
  383. dither(VbCo,xsize,ysize)
  384. END
  385. VbSf=save(dir,i,VbQual,VbSf,name) /*New VbSf in Case of Loader=Saver*/
  386.  
  387. pp_clearbuffer Buffer /*Nötig für w=0 Bildlade check*/
  388. pp_setbuffer Buffer
  389.  
  390. END /*if vbActive=1*/
  391. prog("Indexing...")
  392. makehtml(xsize,ysize,ppz,tborder,VBImgB,i,dir,name,htmid,stellen,gesamt,counter,VbSf,vbActive)
  393. Return 1
  394.  
  395. addslash: procedure
  396.  /*Adds trailling Slash*/
  397. /**********************/
  398.  
  399. name=strip(arg(1))
  400. if substr(name,length(name),1)=":" && substr(name,length(name),1)="/" THEN DO
  401.     Return name
  402.     END
  403. name=name || "/"
  404. return name
  405.  
  406. Dither: Procedure
  407. /*Color Reducing*/
  408.  
  409. Colors=arg(1)
  410. w= arg(2)
  411. h= arg(3)
  412. say dithering
  413. say "colors= " colors
  414.  
  415. if colors=0 then DO
  416. pp_EffectOn
  417. pp_gray
  418. pp_boxf 0 0 w h
  419. pp_EffectOf
  420. colors=8
  421. END
  422. pp_Convert2CMAP colors 0 /*1= Floyd*/
  423.  
  424. return colors
  425.  
  426. save: Procedure
  427.  
  428.  /*Save the Image*/
  429. /****************/
  430.  
  431. dir        =arg(1)
  432. name       =arg(2)
  433. qual       =arg(3)
  434. saveformat =arg(4)
  435. Original   =Arg(5)
  436.  
  437.  
  438.  /*Determining the real saveformat*/
  439. /*********************************/
  440.  
  441.  
  442. if SaveFormat=4 THEN DO /*Speicherformat=LadeFormat*/
  443.     if ~exists("PerfectPaint:Tools/Getimageinfo") THEN SaveFormat=0
  444.     if exists("PerfectPaint:Tools/Getimageinfo") THEN DO
  445.         ADDRESS COMMAND "PerfectPaint:Tools/GetImageInfo " || Original || " %f >t:PfAFormat"
  446.         Open(ForOut,"t:PfAFormat",r)
  447.         tmpFormat=readln(ForOut)
  448.         Close(ForOut)
  449.         Select
  450.             When tmpFormat="JPEG/JFIF" then Saveformat=0
  451.             When tmpFormat="PNG"       then Saveformat=1
  452.             When tmpFormat="GIF89"     then Saveformat=2
  453.             When tmpFormat="IFF-ILBM"  then Saveformat=3
  454.             Otherwise                  DO
  455.                 SaveFormat=0
  456.                 say TmpFormat
  457.                 END
  458.             END
  459.         END
  460.     END
  461.  
  462. format.0=".jpg"
  463. format.1=".png"
  464. format.2=".gif"
  465. format.3=".iff"
  466. name=dir || name || format.saveformat
  467.  
  468.  /*Saving*/
  469. /********/
  470.  
  471. if saveformat=0 then do
  472.     pp_SavePrefs 1 1 qual 0 0 
  473.     pp_Save name 0
  474.     END
  475.  
  476. if SaveFormat=1 then DO
  477.     pp_SavePPM 't:PfPaint_Workfile.pnm'
  478.     pp_asay 'Making*PNG*file*|Please*wait*...'
  479.     ADDRESS COMMAND "Perfectpaint:Tools/pnmtopng t:PfPaint_Workfile.pnm >" || name
  480.     pp_closeAsay        
  481.     ADDRESS COMMAND "delete t:pfpaint_workfile.pnm"
  482.     END
  483. if saveformat=2 then do
  484.     pp_Render 0 'T:pptemp'
  485.     pp_asay 'Making*GIF*file|Please*wait*...'     
  486.     address COMMAND    'perfectpaint:tools/tapgif '||'T:pptemp '||'"'|| name ||'"'
  487.     ADDRESS COMMAND  'delete >nil: T:pptemp'
  488.     pp_closeasay
  489.     end
  490. if saveformat=3 then do
  491.     pp_SavePrefs 0 1
  492.     pp_Save name 0 /*IFF-ILBM*/
  493.     end
  494. return SaveFormat
  495.  
  496.  
  497. scale: Procedure
  498.  
  499.  /*Thumbnail Scaling*/
  500. /*******************/
  501.  
  502. buffer    =arg(1)
  503. thBuffer  =Arg(2)
  504. w         =arg(3)
  505. h         =arg(4)
  506. d         =arg(5)
  507. xsize     =arg(6)
  508. ysize     =arg(7)
  509.  
  510. pp_SetBuffer thBuffer
  511. pp_new w h d
  512. pp_copyframe buffer
  513. pp_scalepicture xsize ysize
  514. return 0
  515.  
  516.  
  517. ppload: Procedure
  518.  
  519.  /*Check and load the Image*/
  520. /**************************/
  521.  
  522. name    =arg(1)
  523.  
  524. load=seekrep(name,' ','*')
  525. say "teste " name
  526. if exists(name) then DO
  527.     say Arg(1) " existiert!"
  528.     pp_load load
  529.     pp_GetHeight
  530.     h=result
  531.     pp_GetWidth
  532.     w=Result
  533.     pp_GetDepth
  534.     d=result
  535.     say "breite=" w
  536.     END
  537. return h";"w";"d
  538.  
  539. smooth: Procedure
  540.  /*Button Rand*/
  541. /*************/
  542.  
  543. x2    =arg(1)
  544. y2    =arg(2)
  545. x1    =0
  546. y1    =0
  547.  
  548. pp_Updateundobox x1 y1 x2 y2
  549. pp_clearrange 0
  550. pp_ComposeReqOff
  551. pp_EffectOn
  552.  
  553.     a=1
  554.     b=3
  555.     size=4
  556. PP_Gradient 0 1  /*Vertical*/
  557. pp_SetRange 0 0 64 64 64 
  558. pp_setRange 0 19 0 0 0
  559. pp_compose a 100 /*Add*/
  560. pp_boxF x1 y1 x2 y1+size /*Oben*/
  561. PP_Gradient 0 0 /*Horizontal*/
  562. pp_BoxF x1 y1 x1+size y2 /*Links*/
  563. PP_Gradient 0 1
  564. pp_SetRange 0 0 0 0 0
  565. pp_setRange 0 19 64 64 64 /*Invert Range*/
  566. pp_Compose b 100 /*Sub*/
  567. pp_BoxF x1 y2 x2 y2-size /*Unten*/
  568. PP_Gradient 0 0 /*Horizontal*/
  569. pp_BoxF x2 y1 x2-size y2 /*Rechts*/
  570.  
  571.     
  572. /*Restore old*/
  573. pp_ClearRange 0
  574. pp_EffectOff
  575. pp_Compose 0 100
  576. return 0
  577.  
  578. SavePrefs: PROCEDURE
  579.  /*Preferences*/
  580. /*************/
  581.  
  582.     Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
  583.     if EXISTS(Prefname) THEN DO
  584.         ADDRESS COMMAND
  585.         'delete >nil: '||Prefname
  586.     END
  587.  
  588.     IF OPEN('pfile',PrefName,'W') THEN DO
  589.  
  590.     do i=2 to ARG()
  591.         CALL WRITELN('pfile',ARG(i))
  592.     end
  593.  
  594.     CALL CLOSE('pfile')
  595.  
  596. RETURN
  597.  
  598. seekrep: Procedure
  599.  /*Seek and Replace*/
  600. /******************/
  601.  
  602. string    =Arg(1)
  603. find      =Arg(2)
  604. replace   =Arg(3)
  605. l         =length(find)
  606.  
  607. do while pos(find,string)~=0
  608.     p=pos(find,string)
  609.     string=insert(replace,delstr(string,p,l),p-1)
  610.     end
  611. return string
  612.  
  613. makehtml: Procedure
  614.  /*Fullsize Image Page*/
  615. /*********************/
  616.  
  617. xsize   = arg(1)
  618. ysize   = arg(2)
  619. ppz     = arg(3)
  620. tborder = arg(4)
  621. outline = arg(5)
  622. i       = arg(6)
  623. dir     = arg(7)
  624. name    = arg(8)
  625. htmid   = arg(9)
  626. stellen = arg(10)
  627. gesamt  = arg(11)
  628. counter = Arg(12)
  629. Saver   = Arg(13)
  630. vbActive= Arg(14)
  631.  
  632. format.0=".jpg"
  633. format.1=".png"
  634. format.2=".gif"
  635. format.3=".iff"
  636.  
  637.  
  638. open(in,htmid,"read")
  639. open(out,dir || i || ".html","write")
  640. input=readch(in,65500)
  641. if vbActive=1 then throutput=htmlcomplete(input,name,xsize,ysize,outline,i,dir,0,0,tborder,stellen,gesamt,counter,format.saver,"yes")
  642. ELSE throutput=htmlcomplete(input,name,xsize,ysize,outline,i,dir,0,0,tborder,stellen,gesamt,counter,format.saver,"no")
  643. writech(out,throutput)
  644. close(out)
  645. close(in)
  646. return 0
  647.  
  648. /*
  649. %N : Name des Bildes
  650. %w : Breite
  651. %H : Höhe
  652. %s : Size in bytes
  653. %br : Bordersize (bild)
  654. %tr : Bordersize (Tabelle)
  655. %dr : Verzeichnis
  656. %FW : Next html file
  657. %BW : previous html file
  658. %I  : Laufnummer (Aktuelles bild)
  659. */ 
  660.  
  661.  
  662. init:
  663. pp_FindEmptyBuffer
  664. Buffer=result
  665.     if Buffer=-1 then DO
  666.         pp_Warn "can't*find*empty|Buffer."
  667.         EXIT        
  668.     END
  669.  
  670.  /*Default Values*/
  671. /****************/
  672.  
  673. dir        ="Ram:"
  674. sdir       ="Ram:"
  675. thsf       =1
  676. thqual     =75
  677. thmax      =1
  678. thxsize    =220
  679. thysize    =160
  680. vbsf       =1
  681. vbqual     =75
  682. vbmax      =1
  683. xsize      =640
  684. ysize      =480
  685. rotate     =0
  686. thali      =1
  687. thflipx    =0
  688. thsmooth   =0
  689. thflipy    =0
  690. vbali      =0
  691. vbflipx    =0
  692. vbsmooth   =0
  693. vbflipy    =0
  694. brush      =0
  695. BrushF     =""
  696. ppz        =4
  697. ThImgB     =1
  698. tborder    =0
  699. vbimgb     =0
  700. pinsel     ="Nein"
  701. httop      ="Perfectpaint:KATalysator/def_html/plain/thTop"
  702. htmid      ="Perfectpaint:KATalysator/def_html/plain/fullsize"
  703. htbot      ="Perfectpaint:KATalysator/def_html/plain/thBottom"
  704. rekursiv = 0
  705. thActive=1
  706. vbActive=1
  707. zps= 0
  708. ThCo = 9
  709. VbCo = 9
  710. Muster='~(#?.info)'
  711.  
  712. call setlang()
  713. pp_verbose 0
  714.  
  715. return 0
  716.  
  717. loadprefs:
  718.  /*Voreinstellungen einladen*/
  719. /***************************/
  720.  
  721.     if EXISTS('PerfectPaint:Prefs/Rexx_Prefs/KATalysator') THEN DO
  722.         IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/KATalysator', "R") then DO
  723.             dir = seekrep(READLN('lfile')," ","*")
  724.             sdir = seekrep(READLN('lfile')," ","*")
  725.             ThSf = readln('lfile')
  726.             thQual = READLN('lfile')
  727.             ThMax = readln('lfile')
  728.             ThXSize=readln('lfile')
  729.             ThYSize=readln('lfile')
  730.             VbSf =  readln('lfile')
  731.             VbQual= READLN('lfile')
  732.             VbMax = readln('lfile')
  733.             XSize = readln('lfile')
  734.             ySize = readln('lfile')
  735.             Rotate= readln('lfile')
  736.             ThAli = readln('lfile')
  737.             ThFlipX=readln('lfile')
  738.             ThSmooth=readln('lfile')
  739.             ThFlipY =readln('lfile')
  740.             VBAli   =readln('lfile')
  741.             VbFlipX =readln('lfile')
  742.             VbSmooth=readln('lfile')
  743.             VbFlipY =readln('lfile')
  744.             Brush   =readln('lfile')
  745.             BrushF  =readln('lfile')
  746.             Pinsel=Platz.brush
  747.             ppz =    READLN('lfile')
  748.             ThImgB = READLN('lfile')
  749.             tborder = READLN('lfile')
  750.             htmid   = READLN('lfile')
  751.             VbImgB  = READLN('lfile')
  752.             httop=  Readln('lfile')
  753.             htbot=  Readln('lfile')
  754.             rekursiv = readln('lfile')
  755.             thActive = readln('lfile')
  756.             vbActive = readln('lfile')
  757.             ZpS      = readln('lfile')
  758.             ThCo     = readln('lfile')
  759.             VbCo     = readln('lfile')
  760.             Muster = readln('lfile')
  761.             CALL CLOSE('lfile')
  762.  
  763.         END
  764.     END
  765. return 0
  766.  
  767. setlang:
  768.  /*Sprache für GUI Initialisieren*/
  769. /********************************/
  770.  
  771. pp_getlocale 1
  772. if result="Öffnen" then DO /*Deutsch*/
  773. gui_titel1   =  "Thumbnail"
  774. gui_titel2   =  "Vollbild"
  775.  
  776. gui_quelle   =  "****Quell*Verzeichnis"
  777. gui_rekursiv =  "mit*Unterverz."
  778. gui_filter   =  "Namensmuster"
  779. gui_ziel     =  "*****Ziel*Verzeichnis"
  780. gui_sformat  =  "******Speicher*Format"
  781. gui_JPGquali =  "********JPEG*Qualität"
  782. gui_imageb   =  "*******Bildrand-Größe"
  783. gui_IMGsize  =  "***Fit*in*Box*/*Größe"
  784. gui_rotation =  "***************Drehen"
  785. gui_intpol   =  "*********AntiAliasing"
  786. gui_softb    =  "*********weicher*Rand"
  787. gui_FlipX    =  "Flip*x"
  788. gui_FlipY    =  "Flip*y"
  789. gui_insertb  =  "******Pinsel*einfügen"
  790.    Platz.1  = "Nein"
  791.    Platz.0  = "Oben*links"
  792.    Platz.10 = "Oben*mitte"
  793.    Platz.20 = "Oben*rechts"
  794.    Platz.3  = "Mitte*Links"
  795.    Platz.13 = "Mitte*mitte"
  796.    Platz.23 = "Mitte*rechts"
  797.    Platz.6  = "Unten*links"
  798.    Platz.16 = "Unten*mitte"
  799.    Platz.26 = "Unten*rechts"
  800. gui_htmlpref =  "HTML*Einstellungen"
  801. gui_file     =  "****************Datei"
  802. gui_tableb   =  "***Tabellenrand-Größe"
  803. gui_BproZ    =  "*****Bilder*pro*Zeile"
  804. gui_BproS    =  "****Bilder*pro*Spalte"
  805. gui_header   =  "***********Kopf-Datei"
  806. gui_body     =  "*******Vollbild-Datei"
  807. gui_foot     =  "************Fuß-Datei"
  808. gui_ThHTML1  =  "***********Kopf-Datei"
  809. gui_ThHTML2  =  "************Fuß-Datei"
  810. gui_VbHTML1  =  "*******Kopf/Fuß-Datei"
  811. gui_brush1="Pinsel*wo*einfügen?"
  812. gui_colors   =  "***************Farben"
  813. END
  814. ELSE DO
  815. gui_titel1   =  "Thumbnail"
  816. gui_titel2   =  "Image"
  817.  
  818. gui_quelle   =  "*****Source*Directory"
  819. gui_rekursiv =  "with*Subdirs"
  820. gui_filter   =  "File*Pattern"
  821. gui_ziel     =  "*****Destination*Dir."
  822. gui_sformat  =  "**********Save*Format"
  823. gui_JPGquali =  "*********JPEG*quality"
  824. gui_imageb   =  "*****Imageborder-Size"
  825. gui_IMGsize  =  "****Fit*in*Box*/*Size"
  826. gui_rotation =  "***************Rotate"
  827. gui_intpol   =  "*********AntiAliasing"
  828. gui_softb    =  "**********Soft-Border"
  829. gui_FlipX    =  "Flip*x"
  830. gui_FlipY    =  "Flip*y"
  831. gui_insertb  =  "*********Insert*Brush"
  832.    Platz.1  = "No"
  833.    platz.0  = "Upper*Left"
  834.    Platz.10 = "Upper*Center"
  835.    Platz.20 = "Upper*Right"
  836.    Platz.3  = "Middle*Left"
  837.    Platz.13 = "Middle*Center"
  838.    Platz.23 = "Middle*Right"
  839.    Platz.6  = "Lower*Left"
  840.    Platz.16 = "Lower*Center"
  841.    Platz.26 = "Lower*Right"
  842. gui_htmlpref =  "HTML*Config"
  843. gui_file     =  "*****************File"
  844. gui_tableb   =  "*****Tableborder-Size"
  845. gui_BproZ    =  "*******Images*per*row"
  846. gui_BproS    =  "*******Images*per*col"
  847. gui_ThHTML1  =  "************Head-File"
  848. gui_ThHTML2  =  "************Foot-File"
  849. gui_VbHTML1  =  "*******Head/Foot-File"
  850. gui_brush1="Insert*Brush*where?"
  851. gui_colors   =  "***************Colors"
  852.     END
  853. return 0
  854.  
  855. opengui:
  856.     DO UNTIL Rr>-1
  857.     setlang()
  858. /* GUI main window */
  859.     pp_DialogInit 462 349 "*KATalysator***©*by*Markus*Castro*&*Antibike" 60
  860.  
  861.       pp_group     0 151 28  160 23  0
  862.       pp_checkbox 51 145 6 20 16 "" 2 ThActive
  863.       pp_text      1 190 22 gui_titel1 1
  864.  
  865.       pp_group     2 313 28  160 23  0
  866.       pp_checkbox 52 307 6 20 16 "" 2 VbActive
  867.       pp_text      3 360 22 gui_titel2 2
  868.  
  869.       pp_group     4 10  53  139 61  0
  870.       pp_text      5 2   48 gui_quelle
  871.       pp_text      6 2   82 gui_ziel
  872.  
  873.       pp_group     7 151 53 322 61  0
  874.       pp_string    8 145 30 160 16 ""      1 100 sdir
  875.       pp_getfile   9 305 31 8      gui_quelle  1 sdir
  876.       pp_checkbox 53 334 32 20 16 "" 2 Rekursiv
  877.       pp_text     54 370 48 gui_rekursiv 2
  878.       pp_string   58 145 47 160 16 ""      1 100 Muster
  879.       pp_text     59 314 65 gui_filter 2
  880.       pp_string   10 145 64 285 16 ""      1 100 dir
  881.       pp_getfile  11 430 65 10      gui_ziel    1 dir
  882.  
  883.       pp_group    12 10  115 139 207 0
  884.       pp_text     13 2   110 gui_sformat
  885.       pp_text     14 2   127 gui_JPGquali
  886.       pp_text     55 2   147 gui_colors
  887.       pp_text     15 2   166 gui_IMGsize
  888.       pp_text     16 2   212 gui_rotation
  889.       pp_text     17 2   235 gui_intpol
  890.       pp_text     18 2   247 gui_softb
  891.       pp_text     19 2   270 gui_insertb
  892.       pp_text     20 2   287 gui_file
  893.  
  894.       pp_group    21 151 115 160 101 0
  895.       PP_Cycle    22 145 92  108 16 "" 1 "JPG|PNG|GIF|IFF|Loader" ThSf
  896.       pp_slider   23 145 109 108 16 "" 1 1 100 ThQual
  897.       PP_Cycle    56 145 129 108 16 "" 1 "8bit*Grey|2|4|8|16|32|64|128|256|24bit" ThCo
  898.       pp_checkbox 24 145 151 20 16 "" 2 ThMax
  899.       pp_string   25 178 149 75 16 "x" 2 10 thXSize
  900.       pp_string   26 178 166 75 16 "y" 2 10 thYSize
  901.  
  902.       pp_group    27 313 115 160 101 0
  903.       PP_Cycle    28 307 92 108 16 "" 1 "JPG|PNG|GIF|IFF|Loader" VbSf
  904.       pp_slider   29 307 109 108 16 "" 1 1 100 VbQual
  905.       PP_Cycle    57 307 129 108 16 "" 1 "8bit*Grey|2|4|8|16|32|64|128|256|24bit" VbCo
  906.       pp_checkbox 30 307 151 20 16 "" 2 VbMax
  907.       pp_string   31 340 149 75 16 "x" 2 10 XSize
  908.       pp_string   32 340 166 75 16 "y" 2 10 YSize
  909.  
  910.       pp_group    33 151 217 322 26  0
  911.       pp_cycle    34 145 194 305 16 "" 1 "0°|90°|180°|270°" rotate
  912.  
  913.       pp_group    35 151 244 160 33  0
  914.       pp_checkbox 36 145 221 20 16 "" 0 ThAli
  915.       pp_checkbox 37 207 221 20 16 gui_FlipX 2 ThFlipX
  916.       pp_checkbox 38 145 234 20 16 "" 0 ThSmooth
  917.       pp_checkbox 39 207 234 20 16 gui_FlipY 2 ThFlipY
  918.  
  919.       pp_group    40 313 244 160 33  0
  920.       pp_checkbox 41 307 221 20 16 "" 0 VbAli
  921.       pp_checkbox 42 370 221 20 16 gui_FlipX 2 VbFlipX
  922.       pp_checkbox 43 307 234 20 16 "" 0 VbSmooth
  923.       pp_checkbox 44 370 234 20 16 gui_FlipY 2 VbFlipY
  924.  
  925.       pp_group    45 151 278 322 44  0
  926.       pp_button   46 145 255 305 16 pinsel
  927.       pp_string   47 145 272 285 16 ""      1 100 BrushF
  928.       pp_getfile  48 430 273 47     gui_insertb 0 BrushF
  929.  
  930.       pp_group    49 10  324 463 26 0
  931.       pp_Button   50 127 301 200 16 gui_htmlpref
  932.  
  933.     pp_Dialog    
  934. /* GUI main window end */
  935.  
  936.     rr=result
  937. say rr
  938.     if rr=0 then
  939.         do
  940.             pp_permitrefresh
  941.             EXIT
  942.         end    
  943. call getvalues()
  944. if rr=-50 then DO until retu=1 | retu=0
  945. /* GUI html config */
  946.     pp_DialogInit 462 254 gui_htmlpref 30
  947.  
  948.       pp_group     0 10  28  463  23 1
  949.       pp_text      1 10  22 gui_titel1 1
  950.  
  951.       pp_group     2 10  53  139 118 0
  952.       pp_text      5 2   49  gui_BproZ
  953.       pp_text      3 2   85  gui_Imageb
  954.       pp_text      4 2   103  gui_tableb
  955.       pp_text      6 2   121 gui_ThHTML1
  956.  
  957.       pp_group     7 151 53  322 118 0
  958.       pp_slider    8 145 30  270 16 "" 1 1 10 ppz
  959.       pp_slider    9 145 66  270 16 "" 1 0 10 ThImgb
  960.       pp_slider   10 145 84  270 16 "" 1 0 10 tborder
  961.       pp_string   11 145 102 250 16 "" 1 100 httop
  962.       pp_getfile  12 395 103 11 gui_ThHTML1 0 httop
  963.       pp_button   13 420 103 32  14 "Edit"
  964.  
  965.       pp_group    14 10  181 463  23 1
  966.       pp_text     15 10  175 gui_titel2 1
  967.  
  968.       pp_group    16 10  206 139 45 0
  969.       pp_text     17 2   202 gui_Imageb
  970.       pp_text     18 2   220 gui_VbHTML1
  971.  
  972.       pp_text     19 2   139 gui_ThHTML2
  973.  
  974.       pp_group    20 151 206 322 45 0
  975.       pp_slider   21 145 183 270 16 "" 1 0 10 VbImgb
  976.       pp_string   22 145 201 250 16 "" 1 100 htmid
  977.       pp_getfile  23 395 202 22  gui_VbHTML1 0 htmid
  978.       pp_button   24 420 202 32  14 "Edit"
  979.  
  980.       pp_text     25 2   67  gui_BproS
  981.       pp_slider   26 145 48  270 16 "" 1 0 10 zps /*Zeilen Pro Seite*/
  982.  
  983.       pp_string   27 145 121 250 16 "" 1 100 htbot
  984.       pp_getfile  28 395 122 27  gui_ThHTML2 0 htbot
  985.       pp_button   29 420 122 32  14 "Edit"
  986.       
  987.     pp_Dialog
  988. /* GUI html config end */
  989. retu=result
  990. if retu~=0 then do
  991.     call gethtmlvalues
  992.     end
  993. say "retu = " retu
  994. say htmid
  995. if retu=-13 then DO
  996.     ADDRESS COMMAND "sys:tools/editpad " || httop
  997.     END
  998. if retu=-23 then DO
  999.     ADDRESS COMMAND "sys:tools/editpad " || htmid
  1000.     END
  1001. if retu=-29 then DO
  1002.     ADDRESS COMMAND "sys:tools/editpad " || htbot
  1003.     END
  1004.  
  1005. END /*HTML Until*/
  1006.  
  1007.  
  1008. if rr=-46 then DO
  1009.     return=BrushAsk(gui_brush1)
  1010.     Parse Var return,posi";"Platz
  1011.     pinsel=platz
  1012.     brush=posi
  1013.     END
  1014.  
  1015. END /*Until*/
  1016. return 0
  1017.  
  1018. gethtmlvalues:
  1019. pp_getdialog 8
  1020. ppz=result
  1021. pp_getdialog 9
  1022. thimgb=result
  1023. pp_getdialog 10
  1024. thborder=result
  1025.  
  1026. pp_getdialog 11
  1027. httop=result
  1028.  
  1029. pp_getdialog 21
  1030. vbimgb=result
  1031.  
  1032. pp_getdialog 22
  1033. htmid=result
  1034.  
  1035. pp_getdialog 26
  1036. ZpS = result /*Zeilen Pro Seite*/
  1037.  
  1038. pp_getdialog 27
  1039. htbot=result
  1040.  
  1041.  
  1042. return 0
  1043.  
  1044. getvalues:
  1045. pp_Getdialog 8
  1046. sdir=addslash(seekrep(upper(result),"RAM DISK:","Ram:"))
  1047. pp_GetDialog 10
  1048. dir=result
  1049. dir=addslash(seekrep(upper(result),"RAM DISK:","Ram:"))
  1050. pp_getdialog 22
  1051. ThSf=result
  1052. pp_getdialog 23
  1053. ThQual=result
  1054. pp_getdialog 24
  1055. thmax=result
  1056. pp_getdialog 25
  1057. thxsize=result
  1058. pp_getdialog 26 
  1059. thysize=result
  1060.  
  1061. pp_getdialog 28
  1062. vbsf=result
  1063. pp_getdialog 29
  1064. vbqual=result
  1065. pp_getdialog 30
  1066. vbmax=result
  1067. pp_getdialog 31
  1068. xsize=result
  1069. pp_getdialog 32
  1070. ysize=result
  1071.  
  1072. pp_getdialog 34
  1073. rotate=result
  1074. pp_getdialog 36
  1075. thali=result
  1076. pp_getdialog 37
  1077. thflipx=result
  1078. pp_getdialog 38
  1079. thsmooth=result
  1080. pp_getdialog 39
  1081. thflipy=result
  1082.  
  1083. pp_getdialog 41
  1084. vbali=result
  1085. pp_getdialog 42
  1086. vbflipx=result
  1087. pp_getdialog 43
  1088. vbsmooth=result
  1089. pp_getdialog 44
  1090. vbflipy=result
  1091.  
  1092.  
  1093.  
  1094. pp_Getdialog 47
  1095. BrushF = result
  1096. if brushF="" then do
  1097.     Brush=1
  1098.     END
  1099.  
  1100. pp_Getdialog 29
  1101. saveformat=result
  1102. if saveformat=2 then do
  1103.     pp_RenderReq 0
  1104.     END
  1105.  
  1106. pp_getdialog 51
  1107. ThActive= Result
  1108. pp_getdialog 52
  1109. VbActive= Result
  1110.  
  1111.  
  1112. pp_getdialog 53
  1113. rekursiv= result
  1114.  
  1115. pp_getdialog 56
  1116. ThCo = Result
  1117.  
  1118. pp_getdialog 57
  1119. VbCo = Result
  1120.  
  1121. pp_getdialog 58
  1122. muster=result
  1123.  
  1124. return 0
  1125.  
  1126. brushask:
  1127.  /*Pinsel Position*/
  1128. /*****************/
  1129.  
  1130. pp_Placegui arg(1)
  1131. posi=abs(result)
  1132. return posi";"Platz.posi
  1133.  
  1134. BrushPlot: Procedure
  1135.  /*Pinsel einfügen*/
  1136. /*****************/
  1137.  
  1138. Brush    =arg(1)
  1139. Pos      =arg(2)
  1140. w        =arg(3)
  1141. h        =arg(4)
  1142.  
  1143. pp_setBrush Brush
  1144. pp_getheightb
  1145. bh=result
  1146. pp_getwidthb
  1147. bw=result
  1148. Select
  1149.     WHEN pos=0 then DO
  1150.         x=bw/2
  1151.         y=bh/2        
  1152.         END
  1153.     WHEN pos=10 then DO
  1154.         x=w/2
  1155.         y=bh/2        
  1156.         END
  1157.     WHEN pos=20 then DO
  1158.         x=w-bw/2
  1159.         y=bh/2        
  1160.         END
  1161.     WHEN pos=3 then DO
  1162.         x=bw/2
  1163.         y=h/2        
  1164.         END
  1165.     WHEN pos=13 then DO
  1166.         x=w/2
  1167.         y=h/2        
  1168.         END
  1169.     WHEN pos=23 then DO
  1170.         x=w-bw/2
  1171.         y=h/2        
  1172.         END
  1173.     WHEN pos=6 then DO
  1174.         x=bw/2
  1175.         y=h-bh/2        
  1176.         END
  1177.     WHEN pos=16 then DO
  1178.         x=w/2
  1179.         y=h-bh/2        
  1180.         END
  1181.     WHEN pos=26 then DO
  1182.         x=w-bw/2
  1183.         y=h-bh/2        
  1184.         END
  1185.     OTHERWISE NOP
  1186. END
  1187. say "plotx=" x
  1188. say "ploty=" y
  1189. pp_plot x y
  1190.  
  1191. Return 0
  1192.  
  1193.  
  1194. BrushInit: Procedure
  1195.  /*Pinsel einladen*/
  1196. /*****************/
  1197.  
  1198. brushf    =arg(1)
  1199.  
  1200. pp_FindEmptyBrush
  1201. Brush=result
  1202.     if Brush=-1 then DO
  1203.         pp_Warn "can't*find*empty|Brush."
  1204.         EXIT        
  1205.     END
  1206. pp_Setbrush Brush
  1207. pp_Bload BrushF
  1208. return Brush
  1209.  
  1210. indexinit: procedure
  1211.  /*Index anlegen/abschließen*/
  1212. /***************************/
  1213.  
  1214. ppz    =arg(1) /*Bilder pro Zeile*/
  1215. tborder=arg(2) /*Tabellen Rand*/
  1216. outline=arg(3) /*Image Rand*/
  1217. thw    =arg(4) 
  1218. thh    =arg(5)
  1219. w      =arg(6)
  1220. h      =arg(7)
  1221. name   =arg(8) /*Name des Bildes*/
  1222. dir    =arg(9)
  1223. i      =value(arg(10))
  1224. file   =arg(11)
  1225. mode   =arg(12)
  1226. stellen=arg(13)
  1227. saver  =Arg(14)
  1228.  
  1229. format.0=".jpg"
  1230. format.1=".png"
  1231. format.2=".gif"
  1232. format.3=".iff"
  1233.  
  1234. open(infile,file,read)
  1235. open(index,dir || "index.html",mode)
  1236. line=readch(infile,65500)
  1237. out=htmlcomplete(line,name,w,h,outline,i,dir,thw,thh,tborder,stellen,1,2,format.aver)
  1238. writeln(index,out)
  1239. close(index)
  1240. close(infile)
  1241. return 0
  1242.  
  1243. indexmake: procedure
  1244.  /*Thumbnails*/
  1245. /************/
  1246.  
  1247. ppz        =arg(1)
  1248. tborder    =arg(2)
  1249. outline    =arg(3)
  1250. thw        =arg(4)
  1251. thh        =arg(5)
  1252. xsize      =arg(6)
  1253. ysize      =arg(7)
  1254. name       =arg(8)
  1255. dir        =arg(9)
  1256. i          =value(arg(10))
  1257. stellen    =arg(11)
  1258. saver      =arg(12)
  1259. thActive   =arg(13)
  1260.  
  1261. say "indexmake, thumbnails, i=" i
  1262.  
  1263. if thActive=1 then line='<TD><A HREF="%I.html"><IMG SRC="th%I' || saver || '" BORDER=%BR WIDTH=%THW HEIGHT=%THH></A><BR><BR><FONT SIZE=-1>%N<BR>(%W x %H)</FONT></TD>'
  1264. ELSE do 
  1265. Line = '<TD><FONT SIZE=-1><A HREF=%I.html>%N</A></FONT></TD>'
  1266. name=aufteilen(name)
  1267. end
  1268. open(index,dir || "index.html","append")
  1269. out=htmlcomplete(line,name,xsize,ysize,outline,i,dir,thw,thh,tborder,stellen,1,2,saver,vbactive)
  1270. writeln(index,out)
  1271. say "ppz=" ppz
  1272. if (i // ppz) = 0 then do
  1273.     writeln(index,"</TR>")
  1274.     writeln(index,"<TR ALIGN=CENTER>")
  1275.     END
  1276. close(index)
  1277. return 0
  1278.  
  1279. htmlcomplete: Procedure
  1280.  /*Seek&Replace %Values*/
  1281. /**********************/
  1282.  
  1283. var     =arg(1)
  1284. name    =arg(2)
  1285. w       =arg(3)
  1286. h       =arg(4)
  1287. outline =arg(5)
  1288. i       =value(arg(6))
  1289. dir     =arg(7)
  1290. thw     =arg(8)
  1291. thh     =arg(9)
  1292. tborder =arg(10)
  1293. stellen =arg(11)
  1294. gesamt  =arg(12)-1
  1295. counter =arg(13)
  1296. format  =arg(14)
  1297. vbactive=arg(15)
  1298. say "Counter/ Gesamt=" Counter " " Gesamt
  1299.  
  1300. throutput=seekrep(var,"%N",name)
  1301. throutput=seekrep(throutput,"%W",w)
  1302. throutput=seekrep(throutput,"%H",h)
  1303. throutput=seekrep(throutput,"%BR",outline) /*Bildrand*/
  1304. throutput=seekrep(throutput,"%TBR",tborder) /*Tabellenrand*/
  1305. if vbactive="yes" then throutput=seekrep(throutput,"%I",i || format)
  1306. if vbactive="no" then throutput=seekrep(throutput,"%I","file:///" || name)
  1307. if vbactive="VBACTIVE" then throutput=seekrep(throutput,"%I",i)
  1308. throutput=seekrep(throutput,"%DR",DIR)
  1309. throutput=seekrep(throutput,"%FO",Format) /*Bild Format*/
  1310.         
  1311. if counter=1 then DO
  1312.         throutput=seekrep(throutput,"%BW","index.html")
  1313.         END
  1314.     ELSE DO
  1315.         throutput=seekrep(throutput,"%BW",right(value(i)-1,stellen,"0") || ".html")
  1316.         END
  1317. if counter=gesamt then DO
  1318.         throutput=seekrep(throutput,"%FW","index.html")
  1319.         END
  1320.     ELSE DO
  1321.         throutput=seekrep(throutput,"%FW",right(i+1,stellen,"0") || ".html")
  1322.         END
  1323.  
  1324. throutput=seekrep(throutput,"%THW",thw)
  1325. throutput=seekrep(throutput,"%THH",thh)
  1326.  
  1327. return throutput
  1328.  
  1329.  
  1330. countlines: Procedure
  1331.  /*Anzahl Bilder feststellen*/
  1332. /***************************/
  1333.  
  1334. name =arg(1)
  1335. file =arg(2)
  1336.  
  1337. open(name,name,r)
  1338. i=0
  1339. do while ~eof(name)
  1340.     x=readln(name)
  1341.     i=i+1
  1342.     END
  1343. close(out)
  1344. return i/*-1*/ /*Zwei Leerzeilen am ende ignorieren...*/
  1345.  
  1346. piccheck: Procedure
  1347.  /*Obsolete*/
  1348. /**********/
  1349.  
  1350. pic=seekrep(arg(1),"Ram Disk:","Ram:")
  1351. /*if exists("Perfectpaint:tools/getimageinfo") then DO
  1352.     ADDRESS COMMAND 'Perfectpaint:Tools/getimageinfo %f >t:picstate ' || pic
  1353.     open(file,"t:picstate",r)
  1354.     y=readln(file)
  1355. say y
  1356.     close(file)
  1357.     if y="???" | word(y,1)="ERROR:" then dO
  1358.         state=0
  1359.         END
  1360.         ELSE DO
  1361.         State=1
  1362.         END
  1363.     END
  1364.     ELSE DO
  1365.     state=1
  1366.     END
  1367. say "Bild " pic " hat state= " state
  1368. */
  1369. return state
  1370.  
  1371.  
  1372. Aufteilen: PROCEDURE
  1373. zeile=arg(1)
  1374.     /*Aufteilung in Pfad und Datei*/
  1375.     size=length(Zeile) 
  1376.     stelle=lastpos("/",Zeile)
  1377.     if stelle=0 then stelle=lastpos(":",Zeile)
  1378.     datei=right(Zeile,size-stelle)
  1379. RETURN datei
  1380.  
  1381.  
  1382. checkHhtmlFiles:
  1383. initvars()
  1384.  /*Check for Existance of HTML Templates*/
  1385. /***************************************/
  1386. if ~exists(httop) then DO
  1387. httop = "t:Pf_Album_Top"
  1388. open(top,httop,w)
  1389. writech(top,htmltop)
  1390. end
  1391. close(top)
  1392.  
  1393. if ~exists(htbot) then DO
  1394. htbot = "t:Pf_Album_Bottom"
  1395. open(bot,htot,w)
  1396. writech(bot,htmlbottom)
  1397. end
  1398. close(bot)
  1399.  
  1400. if ~exists(htmid) then DO
  1401. htmid = "t:Pf_Album_mid"
  1402. open(mid,htmid,w)
  1403. writech(mid,htmlFs)
  1404. end
  1405. close(mid)
  1406.  
  1407. return 0
  1408.  
  1409. initvars:
  1410. htmltop= '<HTML>
  1411. <HEAD>
  1412. <TITLE>HTML Index created by Perfect Album</TITLE>
  1413. <!-- This page was created with KATalysator, © by Saint -->
  1414. </HEAD>
  1415. <BODY BGCOLOR=#FFFFFF>
  1416. <TABLE BORDER=%TBR CELLPADDING=2 CELLSPACING=1>
  1417. '
  1418.  
  1419. htmlBottom= '</TR>
  1420. </TABLE><BR>
  1421. <CENTER><FONT SIZE=-1>Made with KATalysator © by Saint & Antibike</FONT></CENTER>
  1422. </BODY>
  1423. </HTML>'
  1424.  
  1425. HtmlFs = ' <HTML>
  1426. <HEAD>
  1427. <TITLE>%N</TITLE>
  1428. <!-- This page was created with KATalysator © by Saint & Antibike -->
  1429. </HEAD>
  1430. <BODY BGCOLOR=#FFFFFF>
  1431. <CENTER><FONT SIZE=3>%N (%W x %H)</FONT>
  1432. <BR><BR>
  1433.  
  1434. <TABLE BORDER=0 CELLPADDING=2 CELLSPACING=1>
  1435. <TR>
  1436. <TD><FONT SIZE=-1><A HREF="%BW">Previous</A></TD>
  1437. <TD><FONT SIZE=-1><A HREF="index.html">Overview</A></TD>
  1438. <TD><FONT SIZE=-1><A HREF="%FW">Next</A></TD>
  1439. </TR>
  1440. <TR>
  1441. <TD COLSPAN=3><center><FONT SIZE=-1><A HREF="file:///%N">Original</A></CENTER></TD>
  1442. </TR>
  1443. </TABLE>
  1444. <BR><BR>
  1445. <IMG SRC="%I" BORDER=%BR WIDTH=%W HEIGHT=%H ALT="%N">
  1446. </BODY>
  1447. </HTML>'
  1448.  
  1449. return 0
  1450.  
  1451. prog: /*Sets the Progressing*/
  1452. text=arg(1)
  1453. pp_progresstext text
  1454. say "counter bildre" getclip("counter") getclip("bilder")
  1455. pp_progress getclip("counter") getclip("bilder")
  1456. return 0